package com.dyh.quickdemo.tc;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/*
@Author=Joey Wheeler
@Date=2021/4/7 9:56
*/
@Service
@Slf4j
public class Alpha {

    @Autowired
    Beta beta;


    /*
    org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only

	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback
    */
    @Transactional
    public void a(){
        log.info("a...");

        try {
            beta.b();
        } catch (Exception e) {

        }
    }
}
